package com.woshengqile.api.version;

import java.io.Serializable;

import org.apache.commons.lang3.StringUtils;

/**
 * 版本
 */
public class Version implements Serializable {

	private static final long serialVersionUID = 6478133816736701902L;

	private ClientType type; // 终端类型
	private String version; // 版本号
	private String url; // 新版本下载地址
	private String message; // 更新内容
	private String level;

	/**
	 * 检查值是否符合要求*
	 * 
	 * @param type
	 *            终端类型值
	 */
	public static final boolean checkType(String type) {
		if (StringUtils.isEmpty(type)) {
			return false;
		}
		
		ClientType clientType = ClientType.getClientType(type);

		return clientType != null;
	}

	public ClientType getType() {
		return type;
	}

	public void setType(ClientType type) {
		this.type = type;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}
	
}